
public class OverloadCalc {
	
	public int plus(int a) {
		System.out.println("plus(int)");
		return a + a;
	}
	
	public int plus(int a, int b) {
		System.out.println("plus(int, int)");
		return a + b;
	}
	
	public float plus(float a, float b) {
		System.out.println("plus(float, float)");
		return a + b;
	}
	
	public double plus(double a, double b) {
		System.out.println("plus(double, double)");
		return a + b;
	}
	
	public static void main(String[] args) {
		
		OverloadCalc c = new OverloadCalc();
		
		int i = c.plus(3, 5);	// plus(int, int) 호출
		System.out.println("i = " + i);
		
		float f = c.plus(3.0f, 3.2f);
		System.out.println("f = " + f);
		
		double d = c.plus(3.20, 3.114);
		System.out.println("d = " + d);
		
		int i2 = c.plus(4);
		System.out.println("i2 = " + i2);
	}
	
}




















